package com.yangyang.ralearn.common.entity.base;

import com.yangyang.ralearn.common.JEnvironment;
import com.yangyang.ralearn.common.types.JObject;

/**
 * 规划域的抽象谓词
 * 
 * @author yangyang
 * 
 */
public abstract class AbstractDomainPredicate extends BasePredicate {

	/**
	 * 
	 */
	private static final long serialVersionUID = 783935904589257894L;

	public AbstractDomainPredicate(JEnvironment environment, String name,
			JObject[] array) {
		super(environment, name, array);
		// TODO Auto-generated constructor stub
	}

	// 获得predicate的距离
	public abstract int getPreDistance(AbstractDomainPredicate pre);

	// 判断predicate词义是否互相矛盾
	public abstract boolean contraPredicate(AbstractDomainPredicate pre);

	public boolean cntraPredicate(AbstractDomainPredicate... basePredicates) {
		for (AbstractDomainPredicate predicate : basePredicates) {
			if (this.contraPredicate(predicate))
				return true;
		}
		return false;
	}
}
